<template>
	<view style="font-size: 28rpx;">
		<!-- <view class="YongHu-DengLu">
			<view class="XunHuan" v-for="item in userList" @click="clickUserList(item.username)">
				<view class="Zuo">
					<image :src="item.avatar" mode="widthFix"></image>
				</view>
				<view class="Zhong">
					<view class="Zhong-Shang">
						<view>{{item.nickname}}</view>
						<text>{{item.roleName}}</text>
					</view>
					<view class="Zhong-Xia">
						注册时间：{{item.registerDate}}
					</view>
				</view>
				<view class="You">
					<text class="iconfont icon-arrow-double-right"></text>
				</view>
			</view>
		</view> -->
		<public-loading></public-loading>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userList:[]
			}
		},
		onLoad() {
			this.Request();
		},
		methods: {
			Request(){
				this.userList = uni.getStorageSync('account').data.detail.users;
				this.clickUserList(this.userList[0].username)
			},
			clickUserList(e){
				uni.showLoading({ title: "登录中" });
				uni.request({
					url:this.$_Url() + "/api/v2/user/auth",
					method:'POST',
					header:this.$_FresnsHeader(),
					data:{
						"uidOrUsername":e
					},
					success: (res) => {
						uni.hideLoading();
						if(res.data.message == '成功'){
							uni.setStorage({
								key: 'shortNotice',
								data: 'shortNotice',
								success: () => {
									uni.setStorageSync("user",res.data);
									uni.switchTab({
										url:"/pages/my/my"
									})
								}
							});
							
						}else{
							uni.showToast({
								title:res.data.message,
								icon:"none",
								duration:1000
							});
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
.YongHu-DengLu{
	.XunHuan{
		display: flex;
		align-items: center;
		width: 700rpx;
		margin: 25rpx 25rpx 0 25rpx;
		border: 1rpx solid $BianKuangSe;
		padding: 25rpx;
		background: $BeiJingSe;
		border-radius: 10rpx;
		.Zuo{
			width: 80rpx;
			height: 80rpx;
			overflow: hidden;
			border-radius: 100%;
			image{
				display: block;
				width: 100%;
				height: auto;
			}
		}
		.Zhong{
			flex: 1;
			margin: 0 25rpx;
			.Zhong-Shang{
				display: flex;
				align-items: center;
				text{
					font-size: 22rpx;
					color: $ZhanWeiSe;
					padding: 0 0 0 15rpx;
				}
			}
			.Zhong-Xia{
				font-size: 22rpx;
				color: $ZhanWeiSe;
			}
		}
		.You{
			display: flex;
			align-items: center;
			text{
				color: $ZhanWeiSe;
				font-size: 30rpx;
			}
		}
	}
}
</style>